<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<script>
			var Obj = {
				name: '张三',
				age: 23,
				height: 180,

				weight: 130,
				children: [
					{
						title: '123',
					},
					{ title: '456' },
				],
				hobby: ['Basketball', 'Football', 'TableTennis'],
				say() {},
			}
			var a = {
				Obj,
			}
			Obj.a = a

			const Obj_Key_toUpperCase = (value, map = new Map()) => {
				if (value instanceof RegExp) return new RegExp(value)
				if (value instanceof Date) return new Date(value)
				if (value instanceof Function) return value
				if (!(value instanceof Object)) return value
				let result = null
				if (map.has(value)) {
					return value
				}
				map.set(value, result)
				if (value instanceof Array) {
					result = []
					for (let index = 0; index < value.length; index++) {
						result[index] = Obj_Key_toUpperCase(value[index], map)
					}
				} else if (value instanceof Object) {
					result = {}
					for (const key in value) {
						if (Object.hasOwnProperty.call(value, key)) {
							const objectName = key.split('')
							objectName[0] = objectName[0].toUpperCase()
							result[objectName.join('')] = Obj_Key_toUpperCase(value[key], map)
						}
					}
				}
				return result
			}
			console.log(Obj_Key_toUpperCase(a), 4444)
		</script>
	</head>

	<body></body>
</html>
